using System;
using System.Text.RegularExpressions;

namespace NetQueryLib.Expressions
{
	public class ElementNameSelectorExpressionBuilder : SelectorExpressionBuilder
	{
		public override bool AppliesTo(string selector)
		{
			return Regex.IsMatch(selector, @"^[a-zA-Z0-9\-]*$");
		}

		public override SelectorExpression Build(string selector)
		{
			return new ElementNameSelectorExpression(selector);
		}
	}
}